package cz.none.bezbarier.web.model;

import java.util.List;

import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.validation.constraints.NotNull;

import org.datanucleus.api.jpa.annotations.Extension;

import com.google.appengine.datanucleus.annotations.Unowned;

@Entity
public class Place {

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Extension(vendorName = "datanucleus", key = "gae.encoded-pk", value = "true")
	private String id;
	@NotNull
	private String name;
	private String url;
	private String description;
	@NotNull
	private String axisx;
	@NotNull
	private String axisy;
	private Boolean approved;
	@NotNull
	@Unowned
	private User author;
	@NotNull
	@Enumerated(EnumType.STRING)
	private Type type;

	@OneToMany(mappedBy = "place")
	private List<Rating> ratings;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getAxisx() {
		return axisx;
	}

	public void setAxisx(String axisx) {
		this.axisx = axisx;
	}

	public String getAxisy() {
		return axisy;
	}

	public void setAxisy(String axisy) {
		this.axisy = axisy;
	}

	public Boolean getApproved() {
		return approved;
	}

	public void setApproved(Boolean approved) {
		this.approved = approved;
	}

	public User getAuthor() {
		return author;
	}

	public void setAuthor(User author) {
		this.author = author;
	}

	public Type getType() {
		return type;
	}

	public void setType(Type type) {
		this.type = type;
	}

}
